package com.cskaoyan.controller;

import com.cskaoyan.bean.PO.MarketStorage;
import com.cskaoyan.bean.common.BaseRespVo;
import com.cskaoyan.service.AdminStorageService;
import com.cskaoyan.service.WxStorageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;

/**
 * @ClassName WxStorageController
 * @Description TODO
 * @Author ke
 * @Date 2022/8/18 11:39
 * @Version 1.0
 */
@RestController
public class WxStorageController {

    @Autowired
    WxStorageService wxStorageService;

    @RequestMapping("/wx/storage/upload")
    public BaseRespVo upload(MultipartFile file) throws IOException {
        MarketStorage storage= wxStorageService.upload(file);
        return BaseRespVo.ok(0,storage,"成功");
    }
}
